<template>
  <view class="container">
    <text>授权中，请稍候...</text>
  </view>
</template>

<script>
	import common from 'common/common.js';
export default {
	data(){
		return{
			code: '123',
			userId: '',
		}
	},
  onLoad(query) {
    // 在页面加载时获取URL参数中的code
	this.code = document.URL.split("=")[1].split("&")[0];
	this.toApp(this.code)
  },
  methods:{
	  toApp(code){
	  	var _this = this;
	  	uni.request({
	  		url: common.base_url_auth+'/getUserinfo' ,
	  		data:{
	  			"code": code
	  		},
	  		header:{
	  		},
	  		method: 'GET',
	  		success: res => {
	  			// _this.staff = res.data;
	  			// uni.setStorageSync('staff', _this.staff);
	  			// _this.getTaskByIdAndTime();
	  			// _this.getDelayTask();
	  		},
	  		fail: function(e) {
	  			uni.showToast({
	  				title:"唉哟，程序错误了["+JSON.stringify(e)+"]",
	  				icon:"loading"
	  			})
	  		},
	  	});
	  	_this.code = '';
	  },
	  
  }
};
</script>

<style>
/* 样式可以根据实际需求进行定义 */
.container {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100vh;
}
</style>
